<template>
  <div class="RequestConsultation">
    <SubtTitle
      name="申请列表"
      icon-name="operate"
      has-icon
      style="margin-bottom: 10px"
    ></SubtTitle>
    <Table :tableData="tableData" :columnList="columnList" :header="header">
      <template v-slot:Consulationexpert="{ row }">
        <span
          class="Consulationexpert"
          v-for="(item, index) in row.Consulationexpert"
          :key="index"
        >
          {{ item }}
        </span>
      </template>

      <template v-slot:operation="{ row }">
        <div class="btn" @click="onConsulation(row)">进入会诊</div>
      </template>
    </Table>
    <AIRouter :key="activeRouterValue?.path"/>

  </div>
</template>

<script setup>
import { ref, reactive, toRefs, onBeforeMount, onMounted } from "vue";
import SubtTitle from "@/components/Title/subtTitle.vue";
import Table from "@/components/Table/table.vue";
import { useRouter, useRoute } from "vue-router";
const router = useRouter();
const route = useRoute();
const activeRouterValue = ref("");

const header = ref({
  serial: true,
});
const tableData = ref([
  {
    category: "急会诊",
    patient: "李四",
    proposer: "毛宣飞",
    contactway: "15655515151",
    Consulationexpert: ["战三", "李四", "汪伟"],
    applyfortime: "2024-6-20",
  },
  {
    category: "急会诊",
    patient: "李四",
    proposer: "毛宣飞",
    contactway: "15655515151",
    Consulationexpert: ["战三", "李四", "汪伟"],
    applyfortime: "2024-6-20",
  },
  {
    category: "急会诊",
    patient: "李四",
    proposer: "毛宣飞",
    contactway: "15655515151",
    Consulationexpert: ["战三", "李四", "汪伟"],
    applyfortime: "2024-6-20",
  },
]);
const columnList = ref([
  { prop: "category", label: "类别" },
  { prop: "patient", label: "患者" },
  { prop: "proposer", label: "申请人" },
  { prop: "contactway", label: "联系方式" },
  { prop: "Consulationexpert", label: "会诊专家", slot: true },
  { prop: "applyfortime", label: "会诊申请时间" },
  { prop: "operation", label: "操作", slot: true },
]);

const onConsulation = (row)=>{
  console.log(111);
  router.push('/SurgicalMonitoring')
}



</script>
<style scoped lang="scss">
.RequestConsultation {
  span {
    margin-right: 15px;
  }
  .btn {
    color: #77d3ce;
    cursor: pointer;
  }
}
</style>

